@extends('admin.layout.layout')
@section('title','商品管理')

@section('con')
   <div class="widget-box">
	<div class="admin">
  

  	
   	<div class="row">
        <div class="col-lg-6">
            <h1 class="page-header">商品添加</h1>
        </div>
        <!-- /.col-lg-12 -->

    </div>
    <br>
    <br>
		
	 <form role="form"  style="font-size:18px; font-weight:bold;" action="{{url('/admin/goods/insert')}}" method="post" enctype="multipart/form-data">
         <center><div style="width:400px;">
			 @if (count($errors) > 0)
			    <div class="alert alert-danger">
			        <ul>
			            @foreach ($errors->all() as $error)
			                <li>{{ $error }}</li>
			            @endforeach
			        </ul>
			    </div>
			@endif


		</div></center>
          <div class="form-group" >
             
              所属分类: <select class="form-control" name="tid" style="width:300px">
                  
                 @foreach($cates as $k=>$v)
                 <option value="{{$v->tid}}">{{$v->tname}}</option>
                  @endforeach
              </select>
          </div> 
          <br>      
           <div class="form-group">                   
                                 
                商品名称: <input name="gname" style="width:300px;" value="{{old('gname')}}"  type="text" class="form-control">                    
            </div> 
            <br>
            <div class="form-group">                   
                                 
                商品价格: <input name="price" style="width:300px;" value="{{old('price')}}" type="text" class="form-control">                    
            </div>
            <br>
             <div class="form-group">                   
                                 
                商品库存: <input name="cnt" style="width:300px;" value="{{old('cnt')}}" type="text" class="form-control">                    
            </div> 
            <br>
            <div class="form-group">                   
                                 
                商品状态: <input name="status" style="width:300px;" value="{{old('status')}}"  type="text" class="form-control">                    
            </div> 
            <br>
            <div class="form-group">                   
                                
                 商品图片:<input type="file" name="gpic">                   
            </div>        
            <br>

            <script type="text/javascript" charset="utf-8" src="/baiduutf8/ueditor.config.js"></script>
            <script type="text/javascript" charset="utf-8" src="/baiduutf8/ueditor.all.min.js"> </script>
            <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
            <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
            <script type="text/javascript" charset="utf-8" src="/baiduutf8/lang/zh-cn/zh-cn.js"></script>


            <center><div class="control-group" style="width:700px">             
              <div class="controls">
                商品描述:<script id="editor" name="gdesc" value="{{old('gdesc')}}" type="text/plain" style="height:200px" ></script>
              </div>
            </div></center>
            <input type="hidden" name="gid">
                {{csrf_field()}}                
            <br>
            <button class="btn btn-primary" type="submit">添加</button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                     
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <button class="btn btn-danger" type="reset">重置</button>                   
      </form>                        
                                                            
                                 
      </div>   
                           
</div>
@endsection
@section('js')
<script type="text/javascript">
  //实例化编辑器
    
    var ue = UE.getEditor('editor');



</script>
@endsection